package com.xmx.ndmallwxapi.feign.factory;


import com.xmx.common.utils.R;
import com.xmx.ndmallwxapi.feign.CouponFeignClient;
import com.xmx.ndmallwxapi.feign.OrderFeignClient;
import com.xmx.ndmallwxapi.vo.cart.CartAddVo;
import com.xmx.ndmallwxapi.vo.order.OrderGoodVo;
import com.xmx.ndmallwxapi.vo.order.OrderVo;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 用一句话描述
 * @Auther: 新梦想*陈超
 * @Date: 2021/8/11 11:30
 */
@Component
public class OrderFallbackFatory implements FallbackFactory<OrderFeignClient> {


    @Override
    public OrderFeignClient create(Throwable throwable) {
        return new OrderFeignClient() {
            @Override
            public R count(Integer uid) {
                Map map = new HashMap();
                map.put("page","id:0000,msg:请求失败,error:"+ throwable.getMessage());
                return R.ok(map) ;
            }

            @Override
            public R queryExist(Integer goodsId, Integer productId, Integer userId) {
                return null;
            }

            @Override
            public R saveCart(CartAddVo cart) {
                return null;
            }

            @Override
            public R updateCart(Map<String, Object> params) {
                return null;
            }
            @Override
            public R infoCart(Integer id) {
                return null;
            }

            @Override
            public R clearCartGoods(Integer userId) {
                return null;
            }

            @Override
            public R cartdeleteById(Integer[] ids) {
                return null;
            }


            @Override
            public Integer countByOrderSn(Integer userId, String orderSn) {
                return null;
            }

            @Override
            public R addOrder(OrderVo orderVo) {
                return null;
            }

            @Override
            public R submitOrder(Map<String, Object> getdata) {
                return null;
            }

            @Override
            public R addOrderGoods(OrderGoodVo orderGoodVo) {
                return null;
            }
        };
    }
}
